<?php
foreach ($messages as $val) {
       echo "<li>" . $val ."</li>";
    }
?>